/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.view;

/**
 *
 * @author Joanna 8a
 */
public class PanelHorario extends javax.swing.JPanel {

    /**
     * Creates new form PanelHorario
     * @param opc 1: Ver Horario, 2: Modificar Horario, 3: Eliminar Horario
     */
    public PanelHorario(int opc) {
        initComponents();
     if (opc==1){
     setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Ver Horario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), java.awt.Color.orange));
     jButtonEliminarLapso.setVisible(false);
     jButtonGuardar.setVisible(false);
     }
     else if (opc==2){
     setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Modificar Horario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), java.awt.Color.magenta));
     
     jTableHorario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Tiempo", "Duración", "Hora", "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                true, true, true, true, true, true, true, true, true, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
     jButtonEliminarHorario.setVisible(false);
     }
     else if (opc==3){
     setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Eliminar Horario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), java.awt.Color.black));
     jButtonEliminarLapso.setVisible(false);
     jButtonGuardar.setVisible(false);
     }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButtonVolver = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableHorario = new javax.swing.JTable();
        jButtonEliminarLapso = new javax.swing.JButton();
        jButtonGuardar = new javax.swing.JButton();
        jButtonEliminarHorario = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Ver Horario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), java.awt.Color.orange)); // NOI18N

        jButtonVolver.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonVolver.setText("Volver");

        jTableHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jTableHorario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Tiempo", "Duración", "Hora", "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTableHorario);
        jTableHorario.getColumnModel().getColumn(0).setPreferredWidth(35);
        jTableHorario.getColumnModel().getColumn(1).setPreferredWidth(45);
        jTableHorario.getColumnModel().getColumn(2).setPreferredWidth(70);

        jButtonEliminarLapso.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonEliminarLapso.setText("Eliminar Lapso");

        jButtonGuardar.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonGuardar.setText("Guardar");

        jButtonEliminarHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N
        jButtonEliminarHorario.setText("Eliminar Horario");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(138, 138, 138)
                .addComponent(jButtonEliminarLapso)
                .addGap(88, 88, 88)
                .addComponent(jButtonGuardar)
                .addGap(84, 84, 84)
                .addComponent(jButtonEliminarHorario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                .addComponent(jButtonVolver)
                .addGap(133, 133, 133))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonVolver)
                    .addComponent(jButtonEliminarLapso)
                    .addComponent(jButtonGuardar)
                    .addComponent(jButtonEliminarHorario))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonEliminarHorario;
    private javax.swing.JButton jButtonEliminarLapso;
    private javax.swing.JButton jButtonGuardar;
    private javax.swing.JButton jButtonVolver;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableHorario;
    // End of variables declaration//GEN-END:variables
}
